﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLFacade;
using System.Runtime.CompilerServices;

namespace BLFacade
{
    public static class FacadeHolder
    {
        private static IUserFacade userFacade;

        public static IUserFacade UserFacade
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get 
            {
                if (userFacade == null)
                    userFacade = FacadeFactory.BuildUserFacade("BL","BL.UserFacade");
                return userFacade; 
            }
        }

        private static IDataFacade dataFacade;

        public static IDataFacade DataFacade
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get 
            {
                if (dataFacade == null)
                    dataFacade = FacadeFactory.BuildDataFacade("BL", "BL.DataFacade");
                return dataFacade; 
            }
        }
        
    }
}
